package com.authine.cloudpivot.ext.service;

import com.authine.cloudpivot.ext.dto.OrderCustomerDto;
import com.authine.cloudpivot.ext.dto.OrderCustomerGoodsDto;
import com.authine.cloudpivot.ext.dto.system.UserDto;
import com.authine.cloudpivot.ext.model.order.OrderCustomerVO;
import com.authine.cloudpivot.ext.utils.system.SessionUser;
import com.authine.cloudpivot.ext.vo.*;
import com.authine.cloudpivot.ext.vo.i.IOrderCustomerVO;
import com.authine.mvp.app.launcher.dto.bo.response.BOList;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Author: liwei
 * @DateTime: 2021/9/4
 * @Description: TODO
 */
public interface OrderCustomerBaseV1Service {


    BOList listBoAllContainMemberIds(OrderCustomerDto dto);

    BOList listOrderCustomerGoodsContainMemberIds(OrderCustomerGoodsDto orderCustomerGoodsDto);

    List<OrderGoodsV1VO> transferOrderCustomerGoodsV1VOList(BOList boList);

    List<Map<String, Object>> findAllByClientOrderId(String clientOrderId, String currentClientID);

    void createCustomerOrder(Map<String, Object> orderCustomer, UserDto userDto);

    /**
     * 校验 orderSimple
     * @param query
     * @return
     */
    String verifyOrderSimple(Map<String, Object> query);

    /**
     *  OrderSimple 转换成 OrderCustomerVO
     * @param orderSimple
     * @return
     */
    OrderCustomerVO adaptationSimpleToVO(OrderSimple orderSimple, SessionUser sessionUser);

    /**
     * 填充数据
     * @param orderCustomerVO
     * @param sessionUser
     */
    OrderCustomerVO builderCustomerOrder(OrderCustomerVO orderCustomerVO, SessionUser sessionUser);

    /**
     * 根据极简参数创建客户订单接口
     * @param orderCustomerVOBuild 构建好的订单数据
     * @param sessionUser 当前用户
     * @return
     */
    OrderCustomerVO createSimpleCustomerOrder(OrderCustomerVO orderCustomerVOBuild, SessionUser sessionUser);

    /**
     * OrderSimple 转换成 CustomerOrderVo
     * @param orderSimple 订单入参
     * @param sessionUser 用户信息
     * @return 适配的数据返回
     */
    CustomerOrderVo adaptationSaveSimple(OrderSimple orderSimple, SessionUser sessionUser);

    /**
     * 根据 id & 订单状态 获取对应数据是否存在
     * @param orderGoodsId
     * @param s
     * @return
     */
    Boolean getOrderGoods(String orderGoodsId, String s);


    /**
     * 申请退款
     * @param applyRefundVo
     * @return
     */
    List<Map<String, Object>> applyRefund(ApplyRefundVo applyRefundVo);

    /**
     * 构建返回数据
     * @param iOrderCustomerVO
     * @return
     */
    OrderSimpleResult buildOrderSimpleSuccessResult(IOrderCustomerVO iOrderCustomerVO);

    /**
     * 根据订单商品id 获取可发货数量
     * @param orderGoodsId
     * @return
     */
    BigDecimal getOrderGoodsEnableNum(String orderGoodsId);
}
